home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST8-15.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  493b  |  23 lines

  1. ;
  2. ; *** Listing 8-15 ***
  3. ;
  4. ; Adds AL to each element in an array until the result
  5. ; of an addition exceeds 7Fh.
  6. ; Uses LAHF and SAHF.
  7. ;
  8.     jmp    Skip
  9. ;
  10. Data    db    999 dup (0),7fh
  11. ;
  12. Skip:
  13.     mov    bx,offset Data
  14.     mov    al,2    ;we'll add 2 to each array element
  15.     call    ZTimerOn
  16. AddLoop:
  17.     add    [bx],al    ;add the value to this element
  18.     lahf        ;save the sign flag
  19.     inc    bx    ;point to the next array element
  20.     sahf        ;get back the sign flag
  21.     jns    AddLoop    ;do the next element, if any
  22.     call    ZTimerOff
  23.